home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / utility / 372 / utility / abzshell.doc next >
Text File  |  1989-04-20  |  12KB  |  329 lines

  1. Most of Shell I have used can perform esoteric operation but grabs too much1111
  2. memory space to be very useful. The last one that I have used was a 30K
  3. program. This seem no excessive but the drawback is when loaded in memory it
  4. freeze near to 100K.
  5.  
  6. The ABZ Shell is only 5578 bytes long, since it is written entirely in
  7. assembler. When loaded in memory it uses just a bit more than 6K. Naturally,
  8. from its compactness, it cannot include many complex commands. In particular
  9. the input/output redirection is not supported. (The only time I have used
  10. redirection is to read or print a listing, so I have included 2 commands,
  11. SHOW and PRINT in replacement. They are similar to the Desktop dialog box
  12. that appears when you click a non-program file).
  13.  
  14. The Shell uses 17 commands, including 2 conditional one, which can be easily
  15. expanded since the source code is also provided. To add a new command, fill
  16. the keyword list with the name of the command and fill the table of the
  17. command routine address with the address (label) of the new command routine.
  18. The keyword list can be found at 'key_w:' in the DATA section and the
  19. address table at 'call:' in the same section.
  20.  
  21.  
  22. You will find below all details about the use and particulars of the Shell.
  23. It is to try when reading the document.
  24.  
  25. If you have any comment you can contact me via CompuServe [72467,2770], or
  26. writet to:
  27.  
  28.     Alain Birtz
  29.     650 Grand St-Charles, St-Paul d'Abbotsford, P.Q., Canada, J0H-1W0
  30.  
  31.  
  32. You must be patient with my English, I am just learniong it, but I speak
  33. perfectly French...
  34.                                               Bye
  35.  
  36.  
  37. --------------- Upper/Lower case typing and default pathname
  38.  
  39. When typing something in the Shell you must not be worried about using lower
  40. or upper case letter. The Shell makes all commmands and arguments upper case
  41. only before dealing with them. To make the job easier, the shell also
  42. maintains the concept of pathname (folder) by default. The command PATH sets
  43. the current pathname and then other commands can work with the file in this
  44. folder without the use of the complete filename. For example, if the current
  45. pathname has been set to B:\SOURCE\ASM\ by the command 'PATH B:\SOURCE\ASM\'
  46. then to copy the file FILE1 from the drive A, you must just type 'COPY 
  47. A:FILE'. The Shell knows the file must be copied to B:\SOURCE\ASM\.
  48.  
  49.  
  50.  
  51. --------------- The Shell Prompt
  52.  
  53. MS-DOS or PC-DOS operating systems use Shell prompt to tell the user that the
  54. computer is waiting for a command. Usuals prompt are something like A: or B>
  55. The letter before the symbol ':' or '>' is the drive currently active. Our
  56. Shell gives a bit more information by displaying the complete drive/pathname.
  57. Morever, the display is made in reverse video to be more readable. A blank
  58. space in included before the prompt and the cursor blinking position.
  59.  
  60.  
  61.  
  62. --------------- The four types of commands
  63.  
  64.  
  65. The first one changes the default disk. By example A: or B:. The Shell change
  66. the the default pathname according to the argument (A:\ or B:\). You can do
  67. the same thing by the command PATH.
  68.  
  69.  
  70. The second type is the keyword. With such a keyword you can, by example, copy
  71. or delete one or more files. The list of keyword in presentented below.
  72.  
  73. The third type is the programs files.
  74.  
  75. Such files have extensions .PRG, .TOS, .TTP and in some case .IMG. The Shell
  76. starts the execution of the program by just typing the name of the program
  77. file (with or without the extentions) and some optional arguments. After the
  78. execution the control is returned to the Shell. By example EDIT FILE1 start
  79. the program EDIT.TTP and sent FILE1 as argument. WARNING: the TOS cannot
  80. execute GEM program from within an other program, so don't use any GEM
  81. program with the Shell.
  82.  
  83. The fourth type is the BAT file. This kind of file can greatly improve your
  84. work by doing repetitive task. This is a way to extend the list of keywords.
  85. The name BAT comes from the extension filename of these kind of files, know
  86. as BATCH file, like in BOOT.BAT. A BAT file is built with the three previous
  87. types of commands. Each line of a BAT file holds one keyword (and only one,
  88. except for IF_EXIST and IF_NOT_EXIST keyword) followed or not by arguments.
  89. These arguments can be given explicitly or by a variable. The Shell
  90. recognizes five varaibles: %1, %2, %3, %4, %5.
  91.  
  92. A BAT file is called in the same way as a program file. You type the
  93. filename of the BAT file (with or without .BAT extension) followed by the
  94. arguments (like in a .TTP program). The arguments must be separated by one
  95. or more blank spaces (character ascII 9 or 32). The Shell puts the first
  96. argument in the variable %1, the second in %2 and so on. When the BAT
  97. file is called, the Shell replaces every throughout in the file the variable
  98. %1, %2,... by their argument and then executes the command of each line,
  99. one by one. After the last one, the prompt is redisplayed and the Shell
  100. waits for a new user command. 
  101.  
  102. WARNING: don't call a BAT file within a BAT file. Only the first three
  103. types of command are recognixed in a BAT file.
  104.  
  105. As example, you find below the BAT file I have used to assemble and link
  106. the Shell (with AS68.PRG and ALN.PRG in the Atari developper pak).
  107.  
  108. if_exist %1 stop
  109. if_exist %1.prg del %1.prg
  110. if_exist %1.tos del %1.tos
  111. if_not_exist %1.s stop
  112. as68 -N %1.s
  113. aln -o %1.tos %1
  114. del %1.o
  115.  
  116.  
  117.  
  118. --------------- The BOOT.BAT file
  119.  
  120. The Shell can be activated at the startup by copying the ABZSHELL.TOS file
  121. in the the AUTO folder (must be renamed ABZSHELL.PRG). When the Shell is
  122. running for the first time, it check to see if there is if a file named
  123. in BOOT.BATthe startup drive and if there is, it loads and executes this BAT
  124. file. I use such a file to put in my ramdisk all the tools I need to write
  125. my software. So I have put in the AUTO the Shell file ABZSHELL.TOS and the
  126. boot drive C the BAT file BOOT.BAT. This one holds just the two following
  127. lines:
  128.  
  129. if_not_exist e:ABZSHELL.TOS copy c:C_TO_D\*.* e:
  130. e:
  131.  
  132. The first line checks if the Shell (ABZSHELL.TOS) is present in the ramdisk E.
  133. At the startup it is not the case. So there will be an execution of the
  134. second command in the line, that is, the copying of all files in the folder
  135. C_TO_E to the ramdisk E. This folder hold my developpement tools. The ramdisk
  136. I use is resistant to a Reset. After a Reset I don't need to copy my
  137. developpement tools since thet are already in the ramdisk. This time the
  138. first line checks for the file ABZSHELL.TOS (copied from the C_TO_D folder)
  139. and since the file is found go directly to the second line. This one only
  140. sets the current drive as E:, the ramdisk, and I ready to take back my work.
  141.  
  142.  
  143. --------------- The keywords and their uses
  144.  
  145.  
  146.  
  147. -->  Dir:
  148.  
  149. Shows the directory of all files and folder in the disk and/or pathname
  150. given in argument. If no argument is provided the directory of the current
  151. default drive and/or pathname is shown. The date and time of file creation
  152. and the size of the file are also given.
  153.  
  154. Example: CAT B:   or   Cat B:\SOURCE\
  155.  
  156.  
  157.  
  158. -->  Copy:
  159.  
  160. File copy. Take one or two arguments. If only one is provided then the
  161. argument is the file to be copied. In this case the file is copied to the
  162. current default folder. The second argument, if it exists, is the name of the
  163. copied file. You can use the wildcard symbol '?' and '*'. The first matches
  164. any single character and the second matches any string. If a wildcard symbol
  165. is used the second argument must be the destination disk and/or pathname.
  166. The list of all file copied are show to the screen.
  167.  
  168. Example: Copy FILE1   or  Copy FILE1 FILE2   or  Copy FILE?.* B:\SOURCE\
  169.  
  170.  
  171.  
  172. -->  Del:
  173.  
  174. Erases the file given in argument. As for the Copy command you can use
  175. wildcard symbol. At each file the user must give a warrant to delete. In
  176. fact four choices are given: Yes, No, All, Cancel. With 'Y' or 'N' the Shell
  177. erases or not the file and goes to the next file. With 'A' all files are
  178. automatically deleted and with 'C' the file is not deleted and the Shell
  179. exit the DEL command. These choices are not offered if the DEL command is used
  180. within a BAT file.
  181.  
  182. Example: Del FILE1   ou   Del B:\SOURCE\FILE?.*
  183.  
  184.  
  185.  
  186. -->  Rename:
  187.  
  188. This command requests two arguments. The first is the name of file to be
  189. renamed and the second is the new filename. Wildcard symbols are prohibed.
  190.  
  191. Example: Rename B:FILE1 B:FILE2
  192.  
  193.  
  194.  
  195. -->  Path:
  196.  
  197. Set the disk and/or pathname by default. The disk and/or pathname is the
  198. argument of the command.
  199.  
  200. Example: Path B:\SOURCE\
  201.  
  202.  
  203.  
  204. -->  Dfree:
  205.  
  206. Shows the available space (in bytes) on the disk given in argument. If no
  207. argument is given the information is given for the current default disk.
  208.  
  209. Example: Dfree   ou  Dfree B:  ou   Dfree B:\SOURCE\
  210.  
  211.  
  212.  
  213. -->  Mfree:
  214.  
  215.  
  216. Show the free RAM space (in bytes). No argument needed.
  217.  
  218. Example: Mfree
  219.  
  220.  
  221.  
  222. -->  Show:
  223. -->  Print:
  224.  
  225. These two commands are similar to the 'SHOW or  PRINT' found in the dialog
  226. box displayed when you click a file in a desktop directory. Both request
  227. a filename as argument. The first command shows the file to the screen
  228. while the second send the file to the printer. If the file is a text then
  229. the TAB (character ascII 9) is expanded to the 8 characters.
  230. The SHOW command displays the file continuously to the screen. You can
  231. freeze the screen by hitting any key other than 'Q', 'q' or UNDO (these
  232. keys stop the display and exit the SHOW command), and restart the display
  233. by hitting the same key.
  234. The Print command can be interrupt by hitting any key.
  235.  
  236. Example: Show FILE1   or Print B:\SOURCE\FILE2
  237.  
  238.  
  239.  
  240. -->  Cls:
  241.  
  242. Clear the screen and re-display the prompt at the left upper screen corner.
  243. No argument needed.
  244.  
  245. Example: Cls
  246.  
  247.  
  248.  
  249.  
  250. -->  Quit:
  251.  
  252. Exit the Shell and return to the Desktop or to the parent program.
  253. No argument needed. Must be not used in a BAT file.
  254.  
  255. Example: Quit
  256.  
  257.  
  258. -->  ?:
  259.  
  260. Show the list of all commands used by the Shell. No argument needed.
  261.  
  262. Example: ?
  263.  
  264.  
  265. The follwing command must be used only within a BAT file.
  266.  
  267.  
  268.  
  269. --> Stop:
  270.  
  271. Stop the execution of the BAT file. No argument needed.
  272.  
  273. Example: Stop
  274.  
  275.  
  276.  
  277. --> Wait:
  278.  
  279. The execution of the BAT file is suspended. The Shell waits for a user
  280. keyboard input. If the touched key is 'Q', 'q' or UNDO then the Shell exits
  281. the BAT file as for a STOP command, otherwise the Shell resumes the
  282. execution of BAT file. No argument needed.
  283.  
  284. Example: Wait
  285.  
  286.  
  287.  
  288. --> Write:
  289.  
  290. Display to the screen all text sitting at right of this command.
  291. This is the only command where argument can hold blank space.
  292.  
  293. Example: Write BLA BLA BLA
  294.  
  295.  
  296.  
  297. -->  If_exist:
  298. -->  If_not_exist:
  299.  
  300. In a BAT file these commands need at least two arguments.The first one
  301. is a filename, the next must be a normal command line. This command line
  302. will be executed only if the file exists, for IF_EXIST. In contrast the
  303. command line will be executed only if the file does not exist, for
  304. IF_NOT_EXIST.  
  305.  
  306. Example: If_exist FILE1 Del FILE1     or   If_not_exist FILE1 Stop
  307.  
  308.  
  309.  
  310. --------------- Shell command sommary
  311.  
  312. MFREE           Free (RAM) memory space
  313. DFREE           Available space on disk
  314. QUIT            Quit The Shell
  315. DIR             File directory
  316. COPY            File copy
  317. DEL             File delete
  318. REN             Rename file
  319. PATH            Set current default disk and/or pathname
  320. STOP            Stop the execution od the BAT file
  321. WRITE           Write message to the scrren
  322. SHOW            Dsiplay the file to the screen
  323. PRINT           Send the file to the printer
  324. WAIT            Pause in a BAT file
  325. IF_EXIST        Execute only if file exist 
  326. IF_NOT_EXIST    Execute only if file not exist 
  327. CLS             Clear screen
  328. ?               Show the list of all Shell command
  329.